package com.magic.gre.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.magic.gre.R;
import com.magic.gre.widget.wheel.adapter.BaseWheelAdapter;
import com.noname.lib_base_java.util.L;

/**
 * Author: Lmoumou
 * Date: 2019-01-21 17:22
 * 文件名: YearAdapter
 * 描述:
 */
public class YearAdapter extends BaseWheelAdapter<Integer> {
    private Context mContext;

    public YearAdapter(Context context) {
        mContext = context;
    }

    @Override
    protected View bindView(int position, View convertView, ViewGroup parent) {

        WheelAdapter.ViewHolder viewHolder;
        if (convertView == null) {
            viewHolder = new WheelAdapter.ViewHolder();
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_wheel_list, null);
            viewHolder.textView = (TextView) convertView.findViewById(R.id.item_name);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (WheelAdapter.ViewHolder) convertView.getTag();
        }
        L.e("LLSSQQ","position->"+String.valueOf(mList.get(position)));
        viewHolder.textView.setText(String.valueOf(mList.get(position)));
        return convertView;
    }

    static class ViewHolder {
        TextView textView;
    }
}
